
import { createRouter, createWebHistory } from 'vue-router'

//createRouter 创建路由实例
//配置 history 模式
//1,createWebHistory   地址栏不带 # 号
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: () => import('@/views/login/LoginPage.vue') }, //登录页
    {
      path: '/',
      component: () => import('@/views/layout/Layout.vue'),
      redirect: '/login',
      children: [
        {
          path: '/first/FirstPage',
          component: () => import('@/views/first/FirstPage.vue')
        },
        {
          path: '/clocking-in/Clock',
          component: () => import('@/views/clocking-in/Clock.vue')
        },
        {
          path: '/work/Work',
          component: () => import('@/views/work/Work.vue')
        },
        {
          path: '/user/UserCenter',
          component: () => import('@/views/user/UserCenter.vue'),
        },
        {
          name:'user_homepage',
          path: '/user/UserCenter/UserInfo',
          component: () => import('@/views/user/page/user_homepage.vue')
        },
        {
          name:'workRecords',
          path: '/user/UserCenter/workRecords',
          component: () => import('@/views/user/page/work_records.vue')
        },
        {
          name:'salaryRecords',
          path: '/user/UserCenter/salaryRecords',
          component: () => import('@/views/user/page/salary_records.vue')
        },
        {
          name:'attendanceRecord',
          path: '/user/UserCenter/attendanceRecord',
          component: () => import('@/views/user/page/attendance_Record.vue')
        },
        {
          name:'updPassword',
          path: '/user/UserCenter/updPassword',
          component: () => import('@/views/user/page/upd_password.vue')
        },
        {
          path: '/user/UserPassword',
          component: () => import('@/views/user/UserPassword.vue')
        }
      ]
    }
  ]
})

export default router
